<ix-modal-header
  [requiredRoles]="requiredRoles"
  [title]="'Console' | translate"
  [loading]="isFormLoading()"
></ix-modal-header>

<mat-card>
  <mat-card-content>
    <form class="ix-form-container" [formGroup]="form" (submit)="onSubmit()">
      <ix-fieldset>
        <ix-checkbox
          formControlName="consolemenu"
          [label]="'Show Text Console without Password Prompt' | translate"
          [tooltip]="tooltips.consolemenu | translate"
        ></ix-checkbox>

        <ix-checkbox
          formControlName="serialconsole"
          [label]="'Enable Serial Console' | translate"
          [tooltip]="tooltips.serialconsole | translate"
        ></ix-checkbox>

        <ix-select
          formControlName="serialport"
          [label]="'Serial Port' | translate"
          [tooltip]="tooltips.serialport | translate"
          [options]="serialPortOptions$"
        ></ix-select>

        <ix-select
          formControlName="serialspeed"
          [label]="'Serial Speed' | translate"
          [tooltip]="tooltips.serialport | translate"
          [options]="serialSpeedOptions$"
        ></ix-select>

        <ix-textarea
          formControlName="motd"
          [label]="'MOTD Banner' | translate"
          [tooltip]="tooltips.motd | translate"
        ></ix-textarea>
      </ix-fieldset>

      <ix-form-actions>
        <button
          *ixRequiresRoles="requiredRoles"
          mat-button
          type="submit"
          color="primary"
          ixTest="save"
          [disabled]="form.invalid || isFormLoading()"
        >
          {{ 'Save' | translate }}
        </button>
      </ix-form-actions>
    </form>
  </mat-card-content>
</mat-card>
